import request from '@/utils/request'

// 创建分类
export const createCategory = (data) => {
  return request({
    url: '/api/v1/category/create',
    method: 'post',
    data
  })
}

// 更新分类
export const updateCategory = (data) => {
  return request({
    url: '/api/v1/category/update',
    method: 'post',
    data
  })
}

// 删除分类
export const deleteCategory = (params) => {
  return request({
    url: '/api/v1/category/delete',
    method: 'get',
    params
  })
}

// 查询单个分类
export const findOneCategory = (params) => {
  return request({
    url: '/api/v1/category/findOne',
    method: 'get',
    params
  })
}

// 查询所有分类
export const findAllCategory = (params) => {
  return request({
    url: '/api/v1/category/findAll',
    method: 'get',
    params
  })
}

